import { IPSPanelItemCatGroupLogic } from './ipspanel-item-cat-group-logic';
import { PSPanelItemGroupLogicImpl } from './pspanel-item-group-logic-impl';

export class PSPanelItemCatGroupLogicImpl extends PSPanelItemGroupLogicImpl implements IPSPanelItemCatGroupLogic {
  get logicCat(): 'PANELVISIBLE' | 'ITEMENABLE' | 'ITEMBLANK' | 'SCRIPTCODE_CHANGE' | 'SCRIPTCODE_CLICK' | 'SCRIPTCODE_FOCUS' | 'SCRIPTCODE_BLUR' {
    return this.M.logicCat;
  }

  protected relateditemnames: string[] | null = null;

  getRelatedItemNames(): string[] | null {
    if (this.relateditemnames == null) {
      const value = this.M.relatedItemNames;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.relateditemnames = list;
    }
    return this.relateditemnames.length == 0 ? null : this.relateditemnames;
  }

  get relatedItemNames(): string[] | null {
    return this.getRelatedItemNames();
  }

  get cls(): string {
    return 'PSPanelItemCatGroupLogicImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.panel.IPSPanelItemCatGroupLogic') return true;
    return super.instanceof(cls);
  }
}
